<script setup>
	import { ref } from 'vue'
	const props = defineProps({
		seconds: Number,
	})
	const emit = defineEmits(['timup'])
	const count = ref(props.seconds)
	// count.value = seconds
	const time = setInterval(() => {
		count.value--
		if (count.value === 0) {
			clearInterval(time)
			emit('timup')
		}
	}, 1000)
</script>
<template>
	<view>{{ count >= 10 ? count : '0' + count }}</view>
</template>

<style></style>
